﻿USE [PATB_Prod]

GO

/****** Definition Tables *********/
/****** Object:  Table [dbo].[DefFolder] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefFolder](
	[DefFolderID] [int] IDENTITY(1,1) NOT NULL,
	[ParentFolderID] [int] NOT NULL,
	[FolderName] [varchar](255) NOT NULL, /* only one active name can exist at a time */
	[ObjectType] [varchar](50) NULL,
	[Active] [bit] NULL
 CONSTRAINT [DefFolderID] PRIMARY KEY CLUSTERED 
(
	[DefFolderID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Automated Test Bench', '*Root', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, '_Dashboard', '*Dashboard', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Test Cases', 'DefTestCase', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Test Sets', 'DefTestSet', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Base States', 'DefBaseState', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Data Sets', 'DefTestDataSet', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Machines', 'DefTestMachines', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Machine Groups', 'DefTestMachineGroup', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Notification Groups', 'DefNotificationGroup', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Run Definitions', 'DefRun', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Runs', 'Runs:Active', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Lists', '*ListsRoot', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'Action Words', '*List:ActionWords', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', '*List:BaseStateParms', 1)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (12, 'List', 'Placeholder', 0)
INSERT INTO dbo.DefFolder ([ParentFolderID], [FolderName], [ObjectType], [Active]) VALUES (1, 'Results', 'Runs:Results', 1)


SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefList] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefList](
	[DefListID] [int] IDENTITY(1,1) NOT NULL,
	[ListName] [varchar](255) NOT NULL,
	[Description] [varchar](1024) NULL,
	[Active] [bit] NULL,
 CONSTRAINT [DefListID] PRIMARY KEY CLUSTERED 
(
	[DefListID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

/****** Object:  Table [dbo].[DefListItems] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefListItems](
	[DefListItemsID] [int] IDENTITY(1,1) NOT NULL,
	[DefListID] [int] NOT NULL,
	[ListItemValue] [varchar](max) NOT NULL,
 CONSTRAINT [DefListItemsID] PRIMARY KEY CLUSTERED 
(
	[DefListItemsID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefListItems]  WITH CHECK ADD  CONSTRAINT [fk_DefListItems_DefListID] FOREIGN KEY([DefListID])
--REFERENCES [dbo].[DefList] ([DefListID])
--GO

SET ANSI_PADDING OFF
GO

INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('DefTestExecutionOrder', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('DefTestMachineOp', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('OSVendor', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('OSMajorVersion', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('BrowserVersionType', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('NSMeterVersionType', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('BrowserName', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('Firefox-Modules', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('Chrome-Modules', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('Safari-Modules', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('IE-Modules', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('BrowserInstaller', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('TargetSystem', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('AdobeFlashVersionType', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('MSSilverlightVersionType', 1)

INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('NSMI-Apple-Production', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('NSMI-Apple-QA', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('NSMI-Apple-Dev', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('NSMI-Microsoft-Production', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('NSMI-Microsoft-QA', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('NSMI-Microsoft-Dev', 1)

INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('Installer-Chrome-Stable', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('Installer-Firefox-Stable', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('Installer-Chrome-Beta', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('Installer-Firefox-Beta', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('Installer-Chrome-Dev', 1)

INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('Installer-AdobeFlash-Stable', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('Installer-AdobeFlash-Beta', 1)
INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('Installer-MSSilverlight-Stable', 1)

INSERT INTO dbo.DefList ([ListName], [Active]) VALUES ('TestMachineGenericLogin', 1)

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'TargetSystem'), 'NetSight Meter')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'TargetSystem'), 'NetSight Loader')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'DefTestExecutionOrder'), 'None')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'DefTestExecutionOrder'), 'Sequential')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'DefTestMachineOp'), 'Restore per test')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'DefTestMachineOp'), 'Restore initially for set')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'DefTestMachineOp'), 'Restore none')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSVendor'), 'Apple')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSVendor'), 'Microsoft')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'MacOSX-10.05 (Leopard)')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'MacOSX-10.06 (Snow Leopard)')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'MacOSX-10.07 (Lion)')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'MacOSX-10.08 (Mountain Lion)')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'MacOSX-10.09 (Mavericks)')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'MacOSX-10.10 (Syrah)')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'WinXP-Pro-Sp2-x86')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'WinXP-Pro-Sp1-x64')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'WinVista-Ult-Sp2-x86')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'WinVista-Ult-Sp2-x64')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win7-Ult-Sp1-x86-IE8')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win7-Ult-Sp1-x64-IE8')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win7-Ult-x86-Sp1-IE10')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win7-Ult-x64-Sp1-IE10')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win7-Ult-x86-Sp1-IE11')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win7-Ult-x64-Sp1-IE11')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win8.0-Pro-x86')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win8.0-Pro-x64')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win8.1-Pro-x86')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win8.1-Pro-x64')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win8.1-Pro-Update1-x86')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), 'Win8.1-Pro-Update1-x64')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserName'), 'Safari')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserName'), 'Chrome')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserName'), 'IE')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserName'), 'Firefox')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserVersionType'), 'Built-in')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserVersionType'), 'Stable')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserVersionType'), 'Beta')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserVersionType'), 'Dev')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserVersionType'), 'Canary')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'NSMeterVersionType'), 'Production')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'NSMeterVersionType'), 'QA')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'NSMeterVersionType'), 'Dev')


INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Firefox-Modules'), 'FIREFOX')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Firefox-Modules'), 'PLUGIN-CONTAINER')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Firefox-Modules'), 'FLASHPLAYERPLUGIN')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Firefox-Modules'), 'MOZILLA-RUNTIME')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Firefox-Modules'), 'firefox-bin')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Firefox-Modules'), 'coreaudiod')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Chrome-Modules'), 'CHROME')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Chrome-Modules'), 'Google Chrome')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Chrome-Modules'), 'coreaudiod')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Safari-Modules'), 'SAFARI')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Safari-Modules'), 'WEBKIT2WEBPROCESS')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Safari-Modules'), 'PLUGINPROCESS')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Safari-Modules'), 'WEBPROCESS')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Safari-Modules'), 'coreaudiod')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Safari-Modules'), 'com.apple.WebKit')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'IE-Modules'), 'IEXPLORE')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserInstaller'), 'https://www.google.com/intl/en/chrome/browser/')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserInstaller'), 'http://www.mozilla.org/en-US/')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserInstaller'), 'https://www.google.com/chrome/intl/en/eula_beta.html?dl=mac')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserInstaller'), 'http://www.mozilla.org/en-US/firefox/beta/')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserInstaller'), 'https://www.google.com/chrome/intl/en/eula_dev.html?dl=mac')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserInstaller'), 'AUTO')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'NSMI-Apple-Production'), 'http://daywinnmcp002.enterprisenet.org/releases/mac/manager/Lion/5.0.10.8/NielsenInstall_5.0.10.8_revb2ccfee_qa_meta_mid12345678901.dmg')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'NSMI-Apple-QA'), 'http://daywinnmcp002.enterprisenet.org/releases/mac/manager/Lion/5.0.10.2/NielsenInstall_5.0.10.2_rev42ac7ed_qa_meta_mid12345678901.dmg')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'NSMI-Apple-Dev'), 'TBD')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'NSMI-Microsoft-Production'), 'TBD')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'NSMI-Microsoft-QA'), 'TBD')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'NSMI-Microsoft-Dev'), 'TBD')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Installer-Chrome-Stable'), 'https://www.google.com/intl/en/chrome/browser/')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Installer-Firefox-Stable'), 'http://www.mozilla.org/en-US/')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Installer-Chrome-Beta'), 'https://www.google.com/chrome/intl/en/eula_beta.html?dl=mac')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Installer-Firefox-Beta'), 'http://www.mozilla.org/en-US/firefox/beta/')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Installer-Chrome-Dev'), 'https://www.google.com/chrome/intl/en/eula_dev.html?dl=mac')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'AdobeFlashVersionType'), 'Stable')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'AdobeFlashVersionType'), 'Beta')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'MSSilverlightVersionType'), 'Stable')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Installer-AdobeFlash-Stable'), 'file://10.38.225.28/PhoenixTestAutomation/Browser_Addins/AdobeFlash/STABLE/install_flash_player_12_osx.dmg')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Installer-AdobeFlash-Beta'), 'file://10.38.225.28/PhoenixTestAutomation/Browser_Addins/AdobeFlash/BETA/flashplayer13_install_mac.dmg')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'Installer-MSSilverlight-Stable'), 'http://www.microsoft.com/getsilverlight')

INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'TestMachineGenericLogin'), 'NSMeter')
INSERT INTO dbo.DefListItems ([DefListID], [ListItemValue]) VALUES ((SELECT [DefListID] FROM DefList WHERE [ListName] = 'TestMachineGenericLogin'), 'NSMeter')

GO

/****** Object:  Table [dbo].[DefTestDataSet] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefTestDataSet](
	[DefTestDataSetID] [int] IDENTITY(1,1) NOT NULL,
	[DefFolderID] [int] NOT NULL,
	[TestDataSetName] [varchar](255) NOT NULL,
	[Description] [varchar](1024) NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL,
	[DataPointName01] [varchar](255) NOT NULL,
	[DataPointName02] [varchar](255) NULL,
	[DataPointName03] [varchar](255) NULL,
	[DataPointName04] [varchar](255) NULL,
	[DataPointName05] [varchar](255) NULL,
	[DataPointName06] [varchar](255) NULL,
	[DataPointName07] [varchar](255) NULL,
	[DataPointName08] [varchar](255) NULL,
	[DataPointName09] [varchar](255) NULL
 CONSTRAINT [DefTestDataSetID] PRIMARY KEY CLUSTERED 
(
	[DefTestDataSetID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefTestDataSet]  WITH CHECK ADD  CONSTRAINT [fk_DefTestDataSet_DefFolderID] FOREIGN KEY([DefFolderID])
--REFERENCES [dbo].[DefFolder] ([DefFolderID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefTestDataSetData] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefTestDataSetData](
	[DefTestDataSetDataID] [int] IDENTITY(1,1) NOT NULL,
	[DefTestDataSetID] [int] NOT NULL,
	[SeqNo] [int] NOT NULL,
	[DataPointData01] [varchar](max) NOT NULL,
	[DataPointData02] [varchar](max) NULL,
	[DataPointData03] [varchar](max) NULL,
	[DataPointData04] [varchar](max) NULL,
	[DataPointData05] [varchar](max) NULL,
	[DataPointData06] [varchar](max) NULL,
	[DataPointData07] [varchar](max) NULL,
	[DataPointData08] [varchar](max) NULL,
	[DataPointData09] [varchar](max) NULL
 CONSTRAINT [DefTestDataSetDataID] PRIMARY KEY CLUSTERED 
(
	[DefTestDataSetDataID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefTestDataSetData]  WITH CHECK ADD  CONSTRAINT [fk_DefTestDataSetData_DefTestDataSetID] FOREIGN KEY([DefTestDataSetID])
--REFERENCES [dbo].[DefTestDataSet] ([DefTestDataSetID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefTestCase] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefTestCase](
	[DefTestCaseID] [int] IDENTITY(1,1) NOT NULL,
	[DefFolderID] [int] NOT NULL,
	[TestCaseName] [varchar](255) NOT NULL, /* only one active name can exist at a time */
	[QCID] [varchar](10) NULL,
	[TargetSystem] [varchar](255) NULL,
	[BaseState] [varchar](255) NULL,
	[MaxExecutionTimeMins] [int] NULL,
	[Description] [varchar](2048) NULL,
	[Active] [bit] NULL, /* Multiple copies of a TC can exist, we'll keep the old ones but set this to '0' */
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [DefTestCaseID] PRIMARY KEY CLUSTERED 
(
	[DefTestCaseID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefTestCase]  WITH CHECK ADD  CONSTRAINT [fk_DefTestCase_DefFolderID] FOREIGN KEY([DefFolderID])
--REFERENCES [dbo].[DefFolder] ([DefFolderID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefTestStep] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefTestStep](
	[DefTestStepID] [int] IDENTITY(1,1) NOT NULL,
	[DefTestCaseID] [int] NOT NULL,
	[StepName] [varchar](255) NOT NULL,
	[ActionWordID] [int] NOT NULL,
	[SeqNo] [int] NOT NULL
 CONSTRAINT [DefTestStepID] PRIMARY KEY CLUSTERED 
(
	[DefTestStepID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefTestStep]  WITH CHECK ADD  CONSTRAINT [fk_DefTestStep_DefTestCaseID] FOREIGN KEY([DefTestCaseID])
--REFERENCES [dbo].[DefTestCase] ([DefTestCaseID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefTestParam] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefTestParam](
	[DefTestParamID] [int] IDENTITY(1,1) NOT NULL,
	[DefTestStepID] [int] NOT NULL,
	[SeqNo] [int] NOT NULL,
	[ParamName] [varchar](255) NOT NULL,
	[ParamData] [varchar](2048) NOT NULL
 CONSTRAINT [DefTestParamID] PRIMARY KEY CLUSTERED 
(
	[DefTestParamID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefTestParam]  WITH CHECK ADD  CONSTRAINT [fk_DefTestParam_DefTestStepID] FOREIGN KEY([DefTestStepID])
--REFERENCES [dbo].[DefTestStep] ([DefTestStepID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[ActionWords] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ActionWords](
	[ActionWordID] [int] IDENTITY(1,1) NOT NULL,
	[ActionWordName] [varchar](255) NOT NULL,
	[Description] [varchar](1024) NULL,
	[ActionWordType] [varchar](15) NULL,
	[ResultTemplateFail] [varchar](1024) NULL,
	[Active] [bit] NULL
 CONSTRAINT [ActionWordID] PRIMARY KEY CLUSTERED 
(
	[ActionWordID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('<Please Select Action Word>', 'None', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Comment', 'Comment', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Install_NSMeter', 'Setup', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Check_NSMeter', 'Setup', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Install_Browser', 'Setup', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Install_Flash', 'Setup', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Install_Silverlight', 'Setup', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Browser_NewInstance', 'Action', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Browser_NavigateToPage', 'Action', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Browser_NewTab', 'Action', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Browser_ActivateInstance', 'Action', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Browser_ActivateTab', 'Action', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Browser_CloseInstance', 'Action', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Browser_MinimizeInstance', 'Action', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Browser_BackPage', 'Action', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Browser_ForwardPage', 'Action', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Browser_RefreshPage', 'Action', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('LogMonitor_Start', 'Setup', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('LogMonitor_Stop', 'Setup', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('Wait', 'Action', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('VerifyTagPresence', 'Verification', 1)
INSERT INTO dbo.ActionWords ([ActionWordName], [ActionWordType], [Active]) VALUES ('VerifyTagContent', 'Verification', 1)

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefTestSet] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefTestSet](
	[DefTestSetID] [int] IDENTITY(1,1) NOT NULL,
	[DefFolderID] [int] NOT NULL,
	[ExecutionOrder] [int] NOT NULL, -- indexed to DefListItems
	[MachineOp] [int] NOT NULL, -- indexed to DefListItems
	[TestSetName] [varchar](255) NOT NULL,
	[Description] [varchar](1024) NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [DefTestSetID] PRIMARY KEY CLUSTERED 
(
	[DefTestSetID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefTestSet]  WITH CHECK ADD  CONSTRAINT [fk_DefTestSet_ExecutionOrder] FOREIGN KEY([ExecutionOrder])
--REFERENCES [dbo].[DefListItems] ([DefListItemsID])
--GO
--ALTER TABLE [dbo].[DefTestSet]  WITH CHECK ADD  CONSTRAINT [fk_DefTestSet_MachineOp] FOREIGN KEY([MachineOp])
--REFERENCES [dbo].[DefListItems] ([DefListItemsID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefTestSetCases] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefTestSetCases](
	[DefTestSetCasesID] [int] IDENTITY(1,1) NOT NULL,
	[DefTestSetID] [int] NOT NULL,
	[DefTestCaseID] [int] NOT NULL,
	[Order] [float] NOT NULL,
	[DefTestDataSetID] [int] NULL
 CONSTRAINT [DefTestSetCasesID] PRIMARY KEY CLUSTERED 
(
	[DefTestSetCasesID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefTestSetCases]  WITH CHECK ADD  CONSTRAINT [fk_DefTestSetCases_DefTestSetID] FOREIGN KEY([DefTestSetID])
--REFERENCES [dbo].[DefTestSet] ([DefTestSetID])
--GO
--ALTER TABLE [dbo].[DefTestSetCases]  WITH CHECK ADD  CONSTRAINT [fk_DefTestSetCases_DefTestCaseID] FOREIGN KEY([DefTestCaseID])
--REFERENCES [dbo].[DefTestCase] ([DefTestCaseID])
--GO
--ALTER TABLE [dbo].[DefTestSetCases]  WITH CHECK ADD  CONSTRAINT [fk_DefTestSetCases_DefTestDataSetID] FOREIGN KEY([DefTestDataSetID])
--REFERENCES [dbo].[DefTestDataSet] ([DefTestDataSetID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefTestMachines] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefTestMachines](
	[DefTestMachinesID] [int] IDENTITY(1,1) NOT NULL,
	[Location] [varchar](30) NOT NULL,
	[IsVirtual] [bit] NULL,
	[VirtualName] [varchar](255) NULL,
	[VirtualMaxGuests] [int] NULL,
	[Details] [varchar](255) NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [DefTestMachinesID] PRIMARY KEY CLUSTERED 
(
	[DefTestMachinesID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefTestMachineGroup] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefTestMachineGroup](
	[DefTestMachineGroupID] [int] IDENTITY(1,1) NOT NULL,
	[DefFolderID] [int] NOT NULL,
	[TestMachineGroupName] [varchar](255) NOT NULL,
	[Description] [varchar](1024) NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [DefTestMachineGroupID] PRIMARY KEY CLUSTERED 
(
	[DefTestMachineGroupID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefTestMachineGroup]  WITH CHECK ADD  CONSTRAINT [fk_DefTestMachineGroup_DefFolderID] FOREIGN KEY([DefFolderID])
--REFERENCES [dbo].[DefFolder] ([DefFolderID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefTestMachineGroupData] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefTestMachineGroupData](
	[DefTestMachineGroupDataID] [int] IDENTITY(1,1) NOT NULL,
	[DefTestMachineGroupID] [int] NOT NULL,
	[DefTestMachinesID] [int] NOT NULL
 CONSTRAINT [DefTestMachineGroupDataID] PRIMARY KEY CLUSTERED 
(
	[DefTestMachineGroupDataID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefTestMachineGroupData]  WITH CHECK ADD  CONSTRAINT [fk_DefTestMachineGroupData_DefTestMachineGroupID] FOREIGN KEY([DefTestMachineGroupID])
--REFERENCES [dbo].[DefTestMachineGroup] ([DefTestMachineGroupID])
--GO
--ALTER TABLE [dbo].[DefTestMachineGroupData]  WITH CHECK ADD  CONSTRAINT [fk_DefTestMachineGroupData_DefTestMachinesID] FOREIGN KEY([DefTestMachinesID])
--REFERENCES [dbo].[DefTestMachines] ([DefTestMachinesID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[BaseStateParams] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[BaseStateParams](
	[BaseStateParamsID] [int] IDENTITY(1,1) NOT NULL,
	[BaseStateParamName] [varchar](255) NOT NULL,
	[Required] [bit] NULL,
	[DefListID] [int] NULL,
	[DefaultValue] [varchar](255) NULL,
	[Active] [bit] NULL
 CONSTRAINT [BaseStateParamsID] PRIMARY KEY CLUSTERED 
(
	[BaseStateParamsID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('OSVendor', 1, (SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSVendor'), NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('OSMajorVersion', 1, (SELECT [DefListID] FROM DefList WHERE [ListName] = 'OSMajorVersion'), NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('OSLanguage', NULL, NULL, NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('BrowserName', NULL, (SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserName'), NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('BrowserVersionType', NULL, (SELECT [DefListID] FROM DefList WHERE [ListName] = 'BrowserVersionType'), NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('BrowserInstaller', NULL, NULL, 'AUTO', 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('NSMeterID', NULL, NULL, NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('NSMeterVersionType', NULL, (SELECT [DefListID] FROM DefList WHERE [ListName] = 'NSMeterVersionType'), 'AUTO', 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('NSMeterInstaller', NULL, NULL, 'AUTO', 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('AdobeFlashVersionType', NULL, (SELECT [DefListID] FROM DefList WHERE [ListName] = 'AdobeFlashVersionType'), NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('AdobeFlashInstaller', NULL, NULL, 'AUTO', 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('MSSilverlightVersionType', NULL, (SELECT [DefListID] FROM DefList WHERE [ListName] = 'MSSilverlightVersionType'), NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('MSSilverlightInstaller', NULL, NULL, 'AUTO', 1)

INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('TestMode', NULL, NULL, 'Y', 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('TestMode-Log', NULL, NULL, NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('TestMode-Param01', NULL, NULL, NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('TestMode-Param02', NULL, NULL, NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('TestMode-Param03', NULL, NULL, NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('TestMode-Param04', NULL, NULL, NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('TestMode-Param05', NULL, NULL, NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('TestMode-Param06', NULL, NULL, NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('TestMode-Param07', NULL, NULL, NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('TestMode-Param08', NULL, NULL, NULL, 1)
INSERT INTO dbo.BaseStateParams ([BaseStateParamName], [Required], [DefListID], [DefaultValue], [Active]) VALUES ('TestMode-Param09', NULL, NULL, NULL, 1)
GO

/****** Object:  Table [dbo].[DefBaseState] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefBaseState](
	[DefBaseStateID] [int] IDENTITY(1,1) NOT NULL,
	[DefFolderID] [int] NOT NULL,
	[BaseStateName] [varchar](255) NOT NULL,
	[Description] [varchar](1024) NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL,
 CONSTRAINT [DefBaseStateID] PRIMARY KEY CLUSTERED 
(
	[DefBaseStateID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefBaseState]  WITH CHECK ADD  CONSTRAINT [fk_DefBaseState_DefFolderID] FOREIGN KEY([DefFolderID])
--REFERENCES [dbo].[DefFolder] ([DefFolderID])
--GO

/****** Object:  Table [dbo].[DefBaseStateData] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefBaseStateData](
	[DefBaseStateDataID] [int] IDENTITY(1,1) NOT NULL,
	[DefBaseStateID] [int] NOT NULL,
	[BaseStateParamsID] [int] NOT NULL,
	[ParamValue] [varchar](255) NOT NULL,
 CONSTRAINT [DefBaseStateDataID] PRIMARY KEY CLUSTERED 
(
	[DefBaseStateDataID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefBaseStateData]  WITH CHECK ADD  CONSTRAINT [fk_DefBaseStateData_DefBaseStateID] FOREIGN KEY([DefBaseStateID])
--REFERENCES [dbo].[DefBaseState] ([DefBaseStateID])
--GO
--ALTER TABLE [dbo].[DefBaseStateData]  WITH CHECK ADD  CONSTRAINT [fk_DefBaseStateData_BaseStateParamsID] FOREIGN KEY([BaseStateParamsID])
--REFERENCES [dbo].[BaseStateParams] ([BaseStateParamsID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefNotificationGroup] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefNotificationGroup](
	[DefNotificationGroupID] [int] IDENTITY(1,1) NOT NULL,
	[NotificationGroupName] [varchar](255) NOT NULL,
	[Description] [varchar](1024) NULL,
	[Active] [bit] NULL,		
	[CreatedDate] [datetime] NULL,
	[CreatedBy] [varchar](255) NULL
 CONSTRAINT [DefNotificationGroupID] PRIMARY KEY CLUSTERED 
(
	[DefNotificationGroupID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefNotificationGroupData] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefNotificationGroupData](
	[DefNotificationGroupDataID] [int] IDENTITY(1,1) NOT NULL,
	[DefNotificationGroupID] [int] NOT NULL,
	[UserID] [varchar](255) NOT NULL,
	[EmailAddress] [varchar](255) NULL,
	[FriendlyName] [varchar](255) NULL
 CONSTRAINT [DefNotificationGroupDataID] PRIMARY KEY CLUSTERED 
(
	[DefNotificationGroupDataID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefNotificationGroupData]  WITH CHECK ADD  CONSTRAINT [fk_DefNotificationGroupData_DefNotificationGroupID] FOREIGN KEY([DefNotificationGroupID])
--REFERENCES [dbo].[DefNotificationGroup] ([DefNotificationGroupID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefRun] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefRun](
	[DefRunID] [int] IDENTITY(1,1) NOT NULL,
	[DefFolderID] [int] NOT NULL,
	[RunName] [varchar](255) NOT NULL,
	[Description] [varchar](1024) NULL,
	[DefNotificationGroupID] [int] NULL,
	[Active] [bit] NULL,
	[CreatedDate] [datetime] NULL,
	[CreatedBy] [varchar](255) NULL
 CONSTRAINT [DefRunID] PRIMARY KEY CLUSTERED 
(
	[DefRunID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefRun]  WITH CHECK ADD  CONSTRAINT [fk_DefRun_DefFolderID] FOREIGN KEY([DefFolderID])
--REFERENCES [dbo].[DefFolder] ([DefFolderID])
--GO
--ALTER TABLE [dbo].[DefRun]  WITH CHECK ADD  CONSTRAINT [fk_DefRun_DefNotificationGroupID] FOREIGN KEY([DefNotificationGroupID])
--REFERENCES [dbo].[DefNotificationGroup] ([DefNotificationGroupID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[DefRunData] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefRunData](
	[DefRunDataID] [int] IDENTITY(1,1) NOT NULL,
	[DefRunID] [int] NOT NULL,
	[DefTestSetID] [int] NOT NULL,
	[DefBaseStateID] [int] NOT NULL,
	[DefTestMachineGroupID] [int] NOT NULL
 CONSTRAINT [DefRunDataID] PRIMARY KEY CLUSTERED 
(
	[DefRunDataID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[DefRunData]  WITH CHECK ADD  CONSTRAINT [fk_DefRunData_DefRunID] FOREIGN KEY([DefRunID])
--REFERENCES [dbo].[DefRun] ([DefRunID])
--GO
--ALTER TABLE [dbo].[DefRunData]  WITH CHECK ADD  CONSTRAINT [fk_DefRunData_DefTestSetID] FOREIGN KEY([DefTestSetID])
--REFERENCES [dbo].[DefTestSet] ([DefTestSetID])
--GO
--ALTER TABLE [dbo].[DefRunData]  WITH CHECK ADD  CONSTRAINT [fk_DefRunData_DefBaseStateID] FOREIGN KEY([DefBaseStateID])
--REFERENCES [dbo].[DefBaseState] ([DefBaseStateID])
--GO
--ALTER TABLE [dbo].[DefRunData]  WITH CHECK ADD  CONSTRAINT [fk_DefRunData_DefTestMachineGroupID] FOREIGN KEY([DefTestMachineGroupID])
--REFERENCES [dbo].[DefTestMachineGroup] ([DefTestMachineGroupID])
--GO

SET ANSI_PADDING OFF
GO


/****** Object:  Table [dbo].[Runs] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Runs](
	[RunsID] [int] IDENTITY(1,1) NOT NULL,
	[DefFolderID] [int] NOT NULL,
	[DefRunID] [int] NOT NULL,
	[RunName] [varchar](255) NOT NULL,
	[Active] [bit],
	[CreatedDate] [datetime] NULL,
	[CreatedBy] [varchar](255) NULL,
	[Scheduled] [datetime] NOT NULL,
	[Started] [datetime] NULL,
	[Completed] [datetime] NULL,
	[RunTimeSecs] [int] NULL,
	[InProgress] [bit] NULL,
	[LastUpdated] [datetime] NULL,
	[TestCaseCount] [int] NULL,
	[TestCasesCompleted] [int] NULL,
	[ResultsPosted] [bit] NULL,
	[ResultsPostingInProgress] [bit] NULL,
	[ResultsNotificationSent] [bit] NULL,
	[Identifier] [UNIQUEIDENTIFIER] DEFAULT NEWID()
 CONSTRAINT [RunsID] PRIMARY KEY CLUSTERED 
(
	[RunsID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[Runs]  WITH CHECK ADD  CONSTRAINT [fk_Runs_DefFolderID] FOREIGN KEY([DefFolderID])
--REFERENCES [dbo].[DefFolder] ([DefFolderID])
--GO
--ALTER TABLE [dbo].[Runs]  WITH CHECK ADD  CONSTRAINT [fk_Runs_DefRunID] FOREIGN KEY([DefRunID])
--REFERENCES [dbo].[DefRun] ([DefRunID])
--GO

SET ANSI_PADDING OFF
GO

/*************** RESULTS TABLES ****************/
/****** Object:  Table [dbo].[ResTestSet] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ResTestSet](
	[ResTestSetID] [int] IDENTITY(1,1) NOT NULL,
	[DefTestSetID] [int] NOT NULL,
	[RunsID] [int] NOT NULL,
	[DefRunDataID] [int] NOT NULL,
	[DefRunName] [varchar](255) NOT NULL,
	[BaseStateName] [varchar](255) NOT NULL,
	[TestSetName] [varchar](255) NOT NULL,
	[TestMachineGroupName] [varchar](255) NOT NULL,
	[TestDataSetName] [varchar](255) NULL,
	[ExecutionOrder] [varchar](255) NULL,
	[MachineOp] [varchar](255) NULL,
	[LastUpdated] [datetime] NULL,
	[TestCaseCount] [int] NULL,
	[Identifier] [UNIQUEIDENTIFIER] DEFAULT NEWID()
 CONSTRAINT [ResTestSetID] PRIMARY KEY CLUSTERED 
(
	[ResTestSetID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[ResTestSet]  WITH CHECK ADD  CONSTRAINT [ResTestSet_DefTestSetID] FOREIGN KEY([DefTestSetID])
--REFERENCES [dbo].[DefTestSet] ([DefTestSetID])
--GO
--ALTER TABLE [dbo].[ResTestSet]  WITH CHECK ADD  CONSTRAINT [ResTestSet_RunsID] FOREIGN KEY([RunsID])
--REFERENCES [dbo].[Runs] ([RunsID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[ResTestCase] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ResTestCase](
	[ResTestCaseID] [int] IDENTITY(1,1) NOT NULL,
	[ResTestSetID] [int] NOT NULL,
	[DefTestCaseID] [int] NOT NULL,
	[Order] [float] NOT NULL,
	[MaxExecutionTimeMins] [int] NULL,
	[DefTestDataSetDataID] [int] NULL,
	[TestMachineUsed] [varchar](1024) NULL,
	[Result] [varchar](30) NULL,
	[InProgress] [bit] NULL,
	[Completed] [bit] NULL,
	[ResultsPosted] [bit] NULL,
	[Evidence] [bit] NULL,
	[RunTimeSecs] [int] NULL,
	[Identifier] [UNIQUEIDENTIFIER] DEFAULT NEWID(),
	[ErrorMessage] [varchar](MAX) NULL
 CONSTRAINT [ResTestCaseID] PRIMARY KEY CLUSTERED 
(
	[ResTestCaseID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[ResTestCase]  WITH CHECK ADD  CONSTRAINT [ResTestCase_ResTestSetID] FOREIGN KEY([ResTestSetID])
--REFERENCES [dbo].[ResTestSet] ([ResTestSetID])
--GO
--ALTER TABLE [dbo].[ResTestCase]  WITH CHECK ADD  CONSTRAINT [ResTestCase_TestCaseID] FOREIGN KEY([DefTestCaseID])
--REFERENCES [dbo].[DefTestCase] ([DefTestCaseID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[ResTestStep] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ResTestStep](
	[ResTestStepID] [int] IDENTITY(1,1) NOT NULL,
	[ResTestCaseID] [int] NOT NULL,
	[DefTestStepID] [int] NOT NULL,
	[StepName] [varchar](255) NOT NULL,
	[ActionWordName] [varchar](255) NOT NULL,
	[SeqNo] [int] NOT NULL,
	[ResultText] [varchar](max) NOT NULL,
	[Result] [varchar](30) NOT NULL,
	[RunTimeSecs] [int] NULL,
	[Evidence] [bit] NOT NULL
 CONSTRAINT [ResTestStepID] PRIMARY KEY CLUSTERED 
(
	[ResTestStepID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
--ALTER TABLE [dbo].[ResTestStep]  WITH CHECK ADD  CONSTRAINT [ResTestStep_ResTestCaseID] FOREIGN KEY([ResTestCaseID])
--REFERENCES [dbo].[ResTestCase] ([ResTestCaseID])
--GO
--ALTER TABLE [dbo].[ResTestStep]  WITH CHECK ADD  CONSTRAINT [ResTestStep_DefTestStepID] FOREIGN KEY([DefTestStepID])
--REFERENCES [dbo].[DefTestStep] ([DefTestStepID])
--GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[ResTestParam] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ResTestParam](
	[ResTestParamID] [int] IDENTITY(1,1) NOT NULL,
	[ResTestStepID] [int] NOT NULL,
	[SeqNo] [int] NOT NULL,
	[Name] [varchar](255) NOT NULL,
	[Value] [varchar](max) NOT NULL
 CONSTRAINT [ResTestParamID] PRIMARY KEY CLUSTERED 
(
	[ResTestParamID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
--ALTER TABLE [dbo].[ResTestParam]  WITH CHECK ADD  CONSTRAINT [ResTestParam_ResTestStepID] FOREIGN KEY([ResTestStepID])
--REFERENCES [dbo].[ResTestStep] ([ResTestStepID])
--GO

/****** Object:  Table [dbo].[ResTestBaseStateData] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ResTestBaseStateData](
	[ResTestBaseStateDataID] [int] IDENTITY(1,1) NOT NULL,
	[ResTestSetID] [int] NOT NULL,
	[ParamName] [varchar](255) NOT NULL,
	[ParamValue] [varchar](255) NOT NULL,
 CONSTRAINT [ResTestBaseStateDataID] PRIMARY KEY CLUSTERED 
(
	[ResTestBaseStateDataID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

--ALTER TABLE [dbo].[ResTestBaseStateData]  WITH CHECK ADD  CONSTRAINT [ResTestBaseStateData_ResTestSetID] FOREIGN KEY([ResTestSetID])
--REFERENCES [dbo].[ResTestSet] ([ResTestSetID])
--GO


/****** Object:  Table [dbo].[ResTestEvidence] ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ResTestEvidence](
	[ResTestEvidenceID] [int] IDENTITY(1,1) NOT NULL,
	[SourceID] [int] NOT NULL,
	[SourceTable] [varchar](50) NOT NULL,
	[Name] [varchar](1024) NOT NULL,
	[DataType] [varchar](50) NOT NULL,
	[FileName] [varchar](2048) NOT NULL,
	[Description] [varchar](max) NULL,
	[Data] [varbinary](max) NULL
 CONSTRAINT [ResTestEvidenceID] PRIMARY KEY CLUSTERED 
(
	[ResTestEvidenceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[TestStep_line]    Script Date: 12/18/2013 4:21:08 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[TestStep_line](
	[step_lineID_foreignkey] [int] NOT NULL,
	[title1] [varchar](max) NULL,
	[instruction1] [varchar](max) NULL,
	[title2] [varchar](max) NULL,
	[instruction2] [varchar](max) NULL,
	[title3] [varchar](max) NULL,
	[instruction3] [varchar](max) NULL,
	[title4] [varchar](max) NULL,
	[instruction4] [varchar](max) NULL,
	[title5] [varchar](max) NULL,
	[instruction5] [varchar](max) NULL,
	[title6] [varchar](max) NULL,
	[instruction6] [varchar](max) NULL,
	[title7] [varchar](max) NULL,
	[instruction7] [varchar](max) NULL,
	[title8] [varchar](max) NULL,
	[instruction8] [varchar](max) NULL,
	[title9] [varchar](max) NULL,
	[instruction9] [varchar](max) NULL,
	[title10] [varchar](max) NULL,
	[instruction10] [varchar](max) NULL,
	[title11] [varchar](max) NULL,
	[instruction11] [varchar](max) NULL,
	[title12] [varchar](max) NULL,
	[instruction12] [varchar](max) NULL,
	[title13] [varchar](max) NULL,
	[instruction13] [varchar](max) NULL,
	[title14] [varchar](max) NULL,
	[instruction14] [varchar](max) NULL,
	[title15] [varchar](max) NULL,
	[instruction15] [varchar](max) NULL,
	[title16] [varchar](max) NULL,
	[instruction16] [varchar](max) NULL,
	[title17] [varchar](max) NULL,
	[instruction17] [varchar](max) NULL,
	[title18] [varchar](max) NULL,
	[instruction18] [varchar](max) NULL,
	[title19] [varchar](max) NULL,
	[instruction19] [varchar](max) NULL,
	[table_id] [int] IDENTITY(1,1) NOT NULL,
 CONSTRAINT [PK_TestStep_line] PRIMARY KEY CLUSTERED 
(
	[table_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[TestCaseImport]    Script Date: 12/18/2013 4:23:12 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[TestCaseImport](
	[uniqueID] [int] IDENTITY(1,1) NOT NULL,
	[caseName] [varchar](255) NOT NULL,
	[caseID] [varchar](255) NULL,
	[description] [varchar](2048) NULL,
	[baseState] [varchar](150) NULL,
	[dateCreated] [datetime] NULL,
	[createdBy] [varchar](max) NULL,
 CONSTRAINT [PK_TestCaseImport] PRIMARY KEY CLUSTERED 
(
	[uniqueID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[TestCaseImport] ADD  CONSTRAINT [DF_TestCaseImport_dateCreated]  DEFAULT (getdate()) FOR [dateCreated]
GO

/****** Defines Selenium screens and xpath information ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DefFieldElementTypes](
	[DefFieldElementTypeID] [int] NOT NULL,
	[Name] [varchar](255) NOT NULL,
	[Description] [varchar](1024) NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [PK_DefFieldElementTypes] PRIMARY KEY CLUSTERED 
(
	[DefFieldElementTypeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[DefFieldPathTypes](
	[DefFieldPathTypeID] [int] NOT NULL,
	[Name] [varchar](255) NOT NULL,
	[Description] [varchar](1024) NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [PK_DefFieldPathTypes] PRIMARY KEY CLUSTERED 
(
	[DefFieldPathTypeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[DefApps](
	[DefAppID] [int] NOT NULL,
	[AppName] [varchar](255) NOT NULL,
	[Locale] [varchar](6) NOT NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [PK_DefApps] PRIMARY KEY CLUSTERED 
(
	[DefAppID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[DefAppVersions](
	[DefAppVersionID] [int] NOT NULL,
	[VersionName] [varchar](255) NOT NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [PK_DefAppVersions] PRIMARY KEY CLUSTERED 
(
	[DefAppVersionID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[DefAppPages](
	[DefAppPageID] [int] IDENTITY(1,1) NOT NULL,
	[DefAppID] [int] NOT NULL, --- fk to [DefApps]
	[DefAppVersionID] [int] NOT NULL, --- fk to [DefAppVersions]
	[DefAppPagesParentID] [int] NOT NULL, --- fk to [DefAppPages].[DefAppPageID]; Value is zero if root
	[PageName] [varchar](255) NOT NULL,
	[Path] [varchar](2048) NOT NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [PK_DefAppPages] PRIMARY KEY CLUSTERED 
(
	[DefAppPageID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[DefAppPageGroups](
	[DefAppPageGroupID] [int] IDENTITY(1,1) NOT NULL,
	[DefAppPageID] [int] NOT NULL, --- fk to [DefAppPages]
	[GroupName] [varchar](255) NOT NULL,
	[Path] [varchar](2048) NOT NULL,
	[DefFieldPathTypeID] [int] NOT NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [PK_DefAppPageGroups] PRIMARY KEY CLUSTERED 
(
	[DefAppPageGroupID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[DefAppNavMenuPanels](
	[DefAppNavMenuPanelID] [int] IDENTITY(1,1) NOT NULL,
	[DefAppPageID] [int] NOT NULL, --- fk to [DefAppPages]
	[MenuPanelName] [varchar](255) NOT NULL,
	[Path] [varchar](2048) NOT NULL,
	[DefFieldPathTypeID] [int] NOT NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [PK_DefAppNavMenuPanels] PRIMARY KEY CLUSTERED 
(
	[DefAppNavMenuPanelID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[DefAppNavMenuGroups](
	[DefAppNavMenuGroupID] [int] IDENTITY(1,1) NOT NULL,
	[DefAppNavMenuPanelID] [int] NOT NULL, --- fk to [DefAppNavMenuPanels]
	[MenuGroupName] [varchar](255) NOT NULL,
	[Path] [varchar](2048) NOT NULL,
	[DefFieldPathTypeID] [int] NOT NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [PK_DefAppNavMenuGroups] PRIMARY KEY CLUSTERED 
(
	[DefAppNavMenuGroupID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[DefAppNavMenuItems](
	[DefAppNavMenuItemID] [int] IDENTITY(1,1) NOT NULL,
	[DefAppNavMenuGroupID] [int] NOT NULL, --- fk to [DefAppNavMenuGroups]
	[MenuItemName] [varchar](255) NOT NULL,
	[Path] [varchar](2048) NOT NULL,
	[DefFieldPathTypeID] [int] NOT NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [PK_DefAppNavMenuItems] PRIMARY KEY CLUSTERED 
(
	[DefAppNavMenuItemID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[DefAppPageElements](
	[DefAppPageElementID] [int] IDENTITY(1,1) NOT NULL,
	[DefAppPageID] [int] NOT NULL, --- fk to [DefAppPages]
	[DefAppPageGroupID] [int] NULL, --- fk to [DefAppPageGroups]
	[ElementName] [varchar](255) NOT NULL,
	[DefFieldElementTypeID] [int] NOT NULL,
	[Path] [varchar](2048) NOT NULL,
	[DefFieldPathTypeID] [int] NOT NULL,
	[Active] [bit] NULL,
	[LastUpdatedDate] [datetime] NULL,
	[LastUpdatedBy] [varchar](255) NULL
 CONSTRAINT [PK_DefAppPageElements] PRIMARY KEY CLUSTERED 
(
	[DefAppPageElementID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

/*
DROP TABLE [dbo].[ResTestEvidence]
GO
DROP TABLE [dbo].[ResTestBaseStateData]
GO
DROP TABLE [dbo].[ResTestParam]
GO
DROP TABLE [dbo].[ResTestStep]
GO
DROP TABLE [dbo].[ResTestCase]
GO
DROP TABLE [dbo].[ResTestSet]
GO
DROP TABLE [dbo].[Runs]
GO
DROP TABLE [dbo].[DefRunData]
GO
DROP TABLE [dbo].[DefRun]
GO
DROP TABLE [dbo].[DefNotificationGroupData]
GO
DROP TABLE [dbo].[DefNotificationGroup]
GO
DROP TABLE [dbo].[DefBaseStateData]
GO
DROP TABLE [dbo].[DefBaseState]
GO
DROP TABLE [dbo].[BaseStateParams]
GO
DROP TABLE [dbo].[DefTestMachineGroupData]
GO
DROP TABLE [dbo].[DefTestMachineGroup]
GO
DROP TABLE [dbo].[DefTestMachines]
GO
DROP TABLE [dbo].[DefTestSetCases]
GO
DROP TABLE [dbo].[DefTestSet]
GO
DROP TABLE [dbo].[DefTestParam]
GO
DROP TABLE [dbo].[DefTestStep]
GO
DROP TABLE [dbo].[DefTestCase]
GO
DROP TABLE [dbo].[DefListItems]
GO
DROP TABLE [dbo].[DefList]
GO
DROP TABLE [dbo].[ActionWords]
GO
DROP TABLE [dbo].[DefTestDataSetData]
GO
DROP TABLE [dbo].[DefTestDataSet]
GO
DROP TABLE [dbo].[DefFolder]
GO
DROP TABLE [dbo].[TestStep_line]
GO
DROP TABLE [dbo].[TestCaseImport]
GO
*/